using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter41
{
	/// <summary>
	/// Example07: Molar Specific Heat of Hydrogen Gas 
	/// In Figure 21.7(page 652), which shows the molar 
	/// specific heat of hydrogen as a function of temperature, 
	/// vibration does not contribute to the molar specific heat 
	/// at room temperature. Explain why this is so, modeling the 
	/// hydrogen molecule as a simple harmonic oscillator. The 
	/// effective spring constant for the bond in the hydrogen 
	/// molecule is 573 N/m.
	/// </summary>
	public class Example07
	{
		public Example07()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.SimpleHarmonicMotion shm = new L.SimpleHarmonicMotion();
			shm.SpringForceConstant = 573.0;
			shm.Mass = 1.67E-27/2.0;
			shm.FindAngularFrequencyOfMassSpringSystem();
			L.Energy E = new L.Energy();
			E.J = L.Constant.PlankConstant/2.0/Math.PI*shm.AngularFrequency;
			result+=Convert.ToString(E.J)+"\r\n";  
			L.Temperature T = new L.Temperature();
			T.K = 2.0/3.0*E.J/L.Constant.BolzmannConstant;
			result+=Convert.ToString(T.K)+"\r\n";  
		}
	}
}
